// Loggr::Tools::Thread
// Tools make Loggr be more autonomous.
// By George Ulyanov (c) 2010

#ifndef LOGGR_TOOLS_THREAD_H_
#define LOGGR_TOOLS_THREAD_H_

namespace Loggr
{
    namespace Tools
    {
        struct ThreadData;  /** Pre-declaration. */

        /**
        *   @brief Own thread wrapper.
        */
        class Thread
        {
        private:
            ThreadData* m_data;

        public:
            /**
            *   @brief Default constructor.
            */
            Thread();

            /**
            *   @brief Destructor.
            */
            ~Thread() throw();

            /**
            *   @brief Thread starting function.
            */
            void Start(int (* ptfunc)(void*), void* params);

            /**
            *   @brief Thread waiter.
            */
            void Wait();

            /**
            *   @brief Wait for some milliseconds.
            */
            static void Waiter(unsigned int ms);
        };
    }
    // namespace Tools
}
// namespace Loggr

#endif // LOGGR_TOOLS_THREAD_H_
